package cn.linstudy.service;

import cn.linstudy.common.domain.UserInfo;
import cn.linstudy.common.web.Result;
import cn.linstudy.domain.SeckillProduct;
import cn.linstudy.domain.SeckillProductVo;
import java.sql.ResultSet;
import java.util.List;
import org.springframework.stereotype.Service;


public interface ISeckillProductService {

  /**
      * @Description: 根据场次查询秒杀商品
      * @author XiaoLin
      * @date 2021/5/21
      * @Param: [time]
      * @return cn.linstudy.common.web.Result<java.util.List<cn.linstudy.domain.SeckillProductVo>>
      */
  Result<List<SeckillProductVo>> querySeckillProductVOSByTime(int time);
  
  Result<List<SeckillProductVo>> queryByTime(int time);

  /**
      * @Description: 根据seckillid和1time查询单个秒杀商品信息
      * @author XiaoLin
      * @date 2021/5/21
      * @Param: [time, seckillId]
      * @return cn.linstudy.common.web.Result<cn.linstudy.domain.SeckillProductVo>
      */
  Result<SeckillProductVo> find(int time, Long seckillId);

  /**
      * @Description: 秒杀业务逻辑
      * @author XiaoLin
      * @date 2021/5/21
      * @Param: [seckillId, time, phone]
      * @return java.lang.String
      */
  String doSeckill(Long seckillId, int time, Long phone);

  /**
      * @Description: 同步库存，将MySQL中的查询出来，再同步到Redis中
      * @author XiaoLin
      * @date 2021/5/21
      * @Param: [time, seckillId]
      * @return void
      */
  void syncRedisStock(Integer time, Long seckillId);
}
